﻿@model IEnumerable<WebVideo.EntityVideo>
           @{
               ViewBag.Title = "Danh sách video của bạn";
}
<div class="inner-container" id="inner-container" style="width: 8000px">
    <div class="wrap-widget">
        <div class="inner-widget _8">
            <h1>Thông tin tài khoản</h1>

            <div class="widget _2x3 phone bg-color-orangeDark">
                <div class="widget-content" style="float:left;">
                        	<div class="user-wrapper">
                                 @{
                                     string k = "~/Content/Images/Avatar/" + System.Web.HttpContext.Current.Request.Cookies["UserAvatar"].Value;
                                    <div class="avatar"><img src="@Url.Content(k)" alt="" /></div>
                             
                                }
                                <div class="info">
                                	<h4>
                                    	@System.Web.HttpContext.Current.Request.Cookies["UserId"].Value<br />
                                    	<small>@ViewBag.CompanyName</small>
                                    </h4>
                                </div>
                            </div><!--/ user-wrapper-->
                        	<ul class="nav nav-list">
                            	<li>@Html.ActionLink("Thông tin doanh nghiệp", "InfoUser", "Organization")</li>
                                <li class="active">@Html.ActionLink("Thống kê", "Statistic", "Organization")</li>
                                <li>@Html.ActionLink("Gia hạn hợp đồng", "Contract_Renewals", "Organization")</li>
                            </ul>
                        </div><!--/ .widget-content-->
            </div>
                 <div>
                    <!--/ .widget-->
                    @{
                        foreach (var item in Model)
                        {
                           <div class="widget _2xn">
                               @{
                            string kk = "~/Content/Images/Video/" + item.Image;
                                    <img src="@Url.Content(kk)" />
                             
                                }
                    	       
                                <div class="description">
                        	        <h2 class="video-title"> @Html.ActionLink(@item.Name, "NView", "Index", new { IdVideo = @item.Id }, null)</h2>
                                    <p class="statistic-download">@item.Viewed lượt xem  |  <a href="#" onclick="return saveExcel(@item.Id)">Tải xuống</a></p>
                                    <p></p>
                                </div><!--/ description-->
                            </div><!--/ .widget-->
                        }        
                    }
                </div>  
        </div>
        <!--/ .inner-widget-->
    </div>
    <!--/ .wrap-widget -->
</div>
<!--/ .inner-container-->
@section occasionalScripts {
    <script type="text/javascript" src="@Url.Content("~/Content/cssFrontEnd/js/jquery.min.js")" ></script>
    <script type="text/javascript" src="@Url.Content("~/Content/cssFrontEnd/js/load.js")" ></script>
    <script type="text/javascript" src="@Url.Content("~/Content/cssFrontEnd/js/styles.js")" ></script>
    <script type="text/javascript" src="@Url.Content("~/Content/cssFrontEnd/js/jquery.nicescroll.min.js")" ></script>
}
<script type="text/javascript">
    document.body.className = 'no-js'
    $(document).ready(function () {
        $('li#TaiKhoanCuaBan').addClass('active');
    });

    function saveExcel(Id) {
        var postUrl = '@Url.Action("saveExcel", "Organization")';
        $.post(postUrl,{"IdVideo":Id}, function (data) {

            var strTemp = '@Url.Content("~/Content/!!!")';
            strTemp = strTemp.replace("!!!", data);

            window.location = strTemp;
        });
        return true;
    }
</script>
